using System;
using System.Runtime.InteropServices;

namespace Leap
{
	public class InteractionBox : Interface
	{
		private HandleRef swigCPtr;

		public Vector Center
		{
			get
			{
				IntPtr intPtr = LeapPINVOKE.InteractionBox_Center_get(swigCPtr);
				return (intPtr == IntPtr.Zero) ? null : new Vector(intPtr, true);
			}
		}

		public float Width => LeapPINVOKE.InteractionBox_Width_get(swigCPtr);

		public float Height => LeapPINVOKE.InteractionBox_Height_get(swigCPtr);

		public float Depth => LeapPINVOKE.InteractionBox_Depth_get(swigCPtr);

		public bool IsValid => LeapPINVOKE.InteractionBox_IsValid_get(swigCPtr);

		public static InteractionBox Invalid => new InteractionBox(LeapPINVOKE.InteractionBox_Invalid_get(), false);

		public InteractionBox(IntPtr cPtr, bool cMemoryOwn)
			: base(LeapPINVOKE.InteractionBox_SWIGUpcast(cPtr), cMemoryOwn)
		{
			swigCPtr = new HandleRef(this, cPtr);
		}

		public static HandleRef getCPtr(InteractionBox obj)
		{
			return obj?.swigCPtr ?? new HandleRef(null, IntPtr.Zero);
		}

		~InteractionBox()
		{
			Dispose();
		}

		public override void Dispose()
		{
			lock (this)
			{
				if (swigCPtr.Handle != IntPtr.Zero)
				{
					if (base.swigCMemOwn)
					{
						base.swigCMemOwn = false;
						LeapPINVOKE.delete_InteractionBox(swigCPtr);
					}
					swigCPtr = new HandleRef(null, IntPtr.Zero);
				}
				GC.SuppressFinalize(this);
				base.Dispose();
			}
		}

		public InteractionBox()
			: this(LeapPINVOKE.new_InteractionBox(), true)
		{
		}

		public Vector NormalizePoint(Vector position, bool clamp)
		{
			Vector result = new Vector(LeapPINVOKE.InteractionBox_NormalizePoint__SWIG_0(swigCPtr, Vector.getCPtr(position), clamp), true);
			if (LeapPINVOKE.SWIGPendingException.Pending)
			{
				throw LeapPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public Vector NormalizePoint(Vector position)
		{
			Vector result = new Vector(LeapPINVOKE.InteractionBox_NormalizePoint__SWIG_1(swigCPtr, Vector.getCPtr(position)), true);
			if (LeapPINVOKE.SWIGPendingException.Pending)
			{
				throw LeapPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public Vector DenormalizePoint(Vector normalizedPosition)
		{
			Vector result = new Vector(LeapPINVOKE.InteractionBox_DenormalizePoint(swigCPtr, Vector.getCPtr(normalizedPosition)), true);
			if (LeapPINVOKE.SWIGPendingException.Pending)
			{
				throw LeapPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool Equals(InteractionBox arg0)
		{
			bool result = LeapPINVOKE.InteractionBox_Equals(swigCPtr, getCPtr(arg0));
			if (LeapPINVOKE.SWIGPendingException.Pending)
			{
				throw LeapPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public override string ToString()
		{
			return LeapPINVOKE.InteractionBox_ToString(swigCPtr);
		}
	}
}
